openScreen

fun openScreen(scope: String)

Opens a config GUI. Does nothing on the server (But is not marked with @Environment, allowing for safe inclusion anywhere in code)

In order for a screen to exist, Configs must be registered to the ClientConfigRegistry via registerConfig or registerAndLoadConfig

FzzyConfig automatically registered Config GUIs with ModMenu and Catalogue, so you do not strictly need to implement any custom screen opening functionality unless desired.

Author

fzzyhmstrs

Since

0.2.0

Parameters

scope

the scope of the config screen to be opened. This is the "translation key" of the config(s) you want to open. For example, "my_mod:my_config" > "my_mod.my_config" To open a selection screen of every config from a mod, pass the namespace: "my_mod".

Samples

import me.fzzyhmstrs.fzzy_config.FC
import me.fzzyhmstrs.fzzy_config.api.ConfigApi

fun main() { 
   //sampleStart 
   //opens all configs registered under the "fzzy_config" namespace
ConfigApi.openScreen(FC.MOD_ID) 
   //sampleEnd
}